<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>开启BFC解决自身被浮动元素覆盖问题</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .outer{
            width: 300px;
            background-color: gray;
        }
        .box{
            width: 100px;
            height: 100px;
        }
        .box1{
            background-color: green;
            float: left;
        }
        .box2{
            background-color: red;
            /*display: table;*/
            /*float: left;*/
            /*position: absolute;*/
            /*position: fixed;*/
            /*overflow: hidden;*/
            /*column-count: 1;*/
            /*display: flow-root;*/
            display: inline-block;

        }
    </style>
</head>
<body>
<div class="outer">
    <div class=" box box1"></div>
    <div class=" box box2"></div>
</div>
</body>
</html>